package org.itzixi.mapper;

import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.itzixi.enums.Sex;
import org.itzixi.pojo.Users;
import org.itzixi.utils.LocalDateUtils;
import org.springframework.stereotype.Repository;

import java.util.UUID;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author 顾文龙
 * @since 2024-06-12
 */
@Repository
public interface UsersMapper extends BaseMapper<Users> {


    default Users findUserInfoById(String userId){
        return this.selectById(userId);

    }

    default Users findByWechatNumOrMobile(String queryString){
        QueryWrapper<Users> usersQueryWrapper = new QueryWrapper<>();
        usersQueryWrapper.lambda().eq(Users::getWechatNum, queryString)
                .or().eq(Users::getMobile, queryString);
        return this.selectOne(usersQueryWrapper);
    }

}
